import router from '@/router'

router.beforeEach(async(to, from, next) => {
  // set page title
  // const user = userModule.user
  next()
  /* if (user) {
        if (to.path === '/login') {
            // if is logged in, redirect to the home page
            next({path: '/'})
        } else {
            next()
        }
    } else {
        /!* has no token*!/
        if (whiteList.indexOf(to.path) !== -1) {
            // in the free login whitelist, go directly
            next()
        } else {
            // other pages that do not have permission to access are redirected to the login page.
            next({path: '/login' })
        }
    }*/
})

router.afterEach(() => {
  // finish progress bar
})
